package com.designpatterns.singletonpattern.lazysync;

public class Singleton
{
	private static Singleton instance;

	private Singleton()
	{
	}

	// 加锁 synchronized才能保证单例，但加锁会影响效率
	public static synchronized Singleton getInstance()
	{
		if (instance == null)
		{
			instance = new Singleton();
		}
		return instance;
	}
}
